<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>订单列表 </h2>
	</div>
	<div class="cf">
		<div class="fl">
            <!--<a class="btn" href="{:U('add')}">新 增</a>-->
            <!--<button class="btn ajax-post" url="{:U('changeStatus?method=resumeUser')}" target-form="ids">启 用</button>-->
			<button class="btn ajax-post" url="{:U('repayment')}" target-form="ids">还 款</button>
            <!--<button class="btn ajax-post" url="{:U('changeStatus?method=forbidUser')}" target-form="ids">禁 用</button>-->
            <!--<button class="btn ajax-post confirm" url="{:U('changeStatus?method=deleteUser')}" target-form="ids">删 除</button>-->
        </div>

        <!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="nickname" class="search-input" value="{:I('nickname')}" placeholder="请输入用户昵称或者ID">
				<a class="sch-btn" href="javascript:;" id="search" url="{:U('index')}"><i class="btn-search"></i></a>
			</div>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
	<tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">产品名称</th>
		<th class="">IP地址</th>
		<th class="">支付状态</th>
		<th class="">时间</th>
		<th class="">订单号</th>
		<th class="">手机号</th>
		<th class="">金额</th>
		<th class="">份数</th>
		<th class="">金额</th>
		<th class="">购买净值</th>
		<th class="">还款状态</th>
	</tr>
	</thead>
		<tbody>
		<notempty name="_list">
			<volist name="_list" id="vo">
				<tr>
					<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
					<td>{$vo.fund_name} </td>
					<td>{$vo.ip}</td>
					<td><?php
					if($vo['paysuccess'] == 0){
						echo '未支付';
					}elseif($vo['paysuccess'] == 1){
						echo '支付成功';
					}elseif($vo['paysuccess'] == 3){
						echo '用户发送支付请求,等待银行响应';
					}elseif($vo['paysuccess'] == 4){
						echo "系统代支付";
					}elseif($vo['paysuccess'] == 2){
						echo "支付成功";
					}
					?></td>
					<td>{$vo.create_time|time_format}</td>
					<td><span>{$vo.order_no}</span></td>
					<td><span>{$vo.mobile}</span></td>
					<td>{$vo.amount}</td>
					<td>{$vo.count}</td>
					<td>{$vo.amount}</td>
					<td>{$vo.netvalue}</td>
					<td><?php
					if($vo['repayment'] == 0){
						echo '未还款';
					}elseif($vo['repayment'] == 1){
						echo '已还款';
					}
					?></td>
					<!--<td><eq name="vo.status" value="1">-->
					<!--<a href="{:U('User/changeStatus?method=forbidUser&id='.$vo['id'])}" class="ajax-get">禁用</a>-->
					<!--<else/>-->
					<!--<a href="{:U('User/changeStatus?method=resumeUser&id='.$vo['id'])}" class="ajax-get">启用</a>-->
					<!--</eq>-->
					<!--<a href="{:U('AuthManager/group?uid='.$vo['uid'])}" class="authorize">授权</a>-->
					<!--<a href="{:U('User/changeStatus?method=deleteUser&id='.$vo['uid'])}" class="confirm ajax-get">删除</a>-->
					<!--</td>-->
				</tr>
			</volist>
			<else/>
			<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav('{:U('User/index')}');
	</script>
</block>
